<template>
	<view class="_search_btn u-flex u-flex-items-center" :class="{
		'active': active
	}" @click="search">
		<view class="_name ">
			{{ name }}
		</view>
		<view class="u-m-l-10 iconfont f-s-10" :style="{
				color: active ? '#FFF':'#888'
			}">
			&#xe667;
		</view>
	</view>
</template>

<script setup>
	import {
		defineProps
	} from 'vue';
	const emit = defineEmits(['search'])

	const props = defineProps({
		name: String,
		active: {
			type: Boolean,
			default: false
		},
		type: {
			type: String,
			default: 'F'
		}
	})

	function search() {
		emit('search')
	}
</script>

<style lang="scss" scoped>
	._search_btn {
		border-radius: 54rpx;
		height: 54rpx;
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 0 20rpx;
		// background-color: #fff;
		margin-right: 28rpx;

		._name {
			width: max-content;
			height: 40rpx;
			font-size: 28rpx;
			color: #666666;
			line-height: 40rpx;
			font-style: normal;
		}

		._icon {
			width: 18rpx;
			height: 12rpx;
		}
	}

	.active {
		background-color: rgba(32, 128, 247, 1);

		._name {
			color: #fff;
		}
	}
</style>